package top.xiaoshuaila.moments.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import top.xiaoshuaila.moments.pojo.RespBean;
import top.xiaoshuaila.moments.service.ZanService;

@Controller
@RequestMapping("zan")
@Api(tags = "点赞操作接口")
public class ZanController {
    @Autowired
    private ZanService zanService;
    @PutMapping("dianzan")
    @ResponseBody
    @ApiOperation("点赞操作")
    public RespBean dianzan(long dyid,long userid,String dyname){
        return RespBean.success("success",zanService.dianzan(dyid,userid,dyname));
    }
    @PostMapping("zhuanfa")
    @ResponseBody
    @ApiOperation("转发操作")
    public RespBean zhuanfa(String dyid){
        return RespBean.success("success",zanService.zhuanfa(dyid));
    }
    @GetMapping("gettotal")
    @ResponseBody
    @ApiOperation("获取动态点赞总数")
    public RespBean gettotal(long dyid){
        System.out.println(dyid);
        return RespBean.success("success",zanService.gettotal(dyid));
    }
}
